home *** CD-ROM | disk | FTP | other *** search
- Path: news.uni-jena.de!news
- From: mkt@isun04.inf.uni-jena.de (Tilo Koerbs)
- Newsgroups: comp.lang.c++
- Subject: Re: Derived->Base a Signature match?
- Date: 1 Feb 1996 12:16:36 GMT
- Organization: Lehrstuhl fuer Rechnerarchitektur- und kommunikation, FSU Jena
- Message-ID: <4eqav4$fpu@fsuj01.rz.uni-jena.de>
- References: <4ep035$kdp@darkstar.UCSC.EDU>
- Reply-To: mkt@isun04.inf.uni-jena.de
- NNTP-Posting-Host: isun07.inf.uni-jena.de
-
- > Derived d;
- > Base b;
- >
- > b = b + d; // is d converted to b by signature match (user-defined
- > // conversion) or is it an exact match due
- > // to language rules?
-
- Answer: An object of a derived class type can be used to initialized
- a reference of a base class type. (language rule)
-
- That means: The complete object d is passed to operator+(B&).
- This can be watched by calling a virtual function inside
- operator+ .
-
- Bye.
-
-
-